package org.example.service;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.entity.Audit;
import org.example.entity.Documents;
import org.example.entity.User;
import org.example.mapper.AuditMapper;
import org.example.mapper.DocumentsMapper;
import org.example.mapper.UserMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DocumentsService extends ServiceImpl<DocumentsMapper, Documents> {
    @Resource
    DocumentsMapper documentsMapper;

    public void saveDocument(String name,String type) {
        Documents documents = new Documents();
        documents.setName(name);
        documents.setType(type);
        documentsMapper.insert(documents);
    }

    public void saveUrl(String url) {
        Documents documents=new Documents();
        documents.setAddress(url);
        documentsMapper.insert(documents);
    }
}
